﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;



namespace Performance_Test
{
    public partial class Performance_Test
    {
        private void scanning_display_motion_tolerance()
        {
            lblScanningTime.Invoke(new EventHandler(delegate
            {

                lblScanningTime.Text = st.ToString();

            }));
            lblSumLabels.Invoke(new EventHandler(delegate
            {

                lblSumLabels.Text = Execuse.SumLabels(Motion, Distance, scaning_time).ToString();
            }));
            lblGoodRead.Invoke(new EventHandler(delegate
            {

                GoodCount = Execuse.GoodReadData(InputData, data_label_1, data_label_2, data_label_3, data_label_4, GoodCount);
                lblGoodRead.Text = GoodCount.ToString();
            }));
            lblIncorrect.Invoke(new EventHandler(delegate
            {

                IncorrectCount = Execuse.InCorrectReadData(InputData, data_label_1, data_label_2, data_label_3, data_label_4, IncorrectCount);
                lblIncorrect.Text = IncorrectCount.ToString();
            }));
            lblMissRead.Invoke(new EventHandler(delegate
            {

                MissRead = Execuse.MissReadData(Execuse.SumLabels(Motion, Distance, scaning_time), Execuse.GoodReadData(InputData, data_label_1, data_label_2, data_label_3, data_label_4, GoodCount), IncorrectCount);
                lblMissRead.Text = MissRead.ToString();
            }));
            lblReadingRate.Invoke(new EventHandler(delegate
            {

                lblReadingRate.Text = Execuse.ReadingRate(Execuse.SumLabels(Motion, Distance, scaning_time), GoodCount).ToString() + "%";
            }));
        }
    
        private void cmbNumLabel_SelectedIndexChanged(object sender, EventArgs e)
        {
            string text = cmbNumLabel.Text.Trim();
            label_num = Convert.ToInt32(cmbNumLabel.Text);
            switch (text)
            {
                case "1":
                    label27.Visible = true;
                    txtLabel1.Visible = true;
                    label28.Visible = false;
                    txtLabel2.Visible = false;
                    label29.Visible = false;
                    txtLabel3.Visible = false;
                    label30.Visible = false;
                    txtLabel4.Visible = false;
                    break;

                case "2":
                    label27.Visible = true;
                    txtLabel1.Visible = true;
                    label28.Visible = true;
                    txtLabel2.Visible = true;
                    label29.Visible = false;
                    txtLabel3.Visible = false;
                    label30.Visible = false;
                    txtLabel4.Visible = false;


                    break;
                case "3":
                    label27.Visible = true;
                    txtLabel1.Visible = true;
                    label28.Visible = true;
                    txtLabel2.Visible = true;
                    label29.Visible = true;
                    txtLabel3.Visible = true;
                    label30.Visible = false;
                    txtLabel4.Visible = false;


                    break;
                case "4":
                    label27.Visible = true;
                    txtLabel1.Visible = true;
                    label28.Visible = true;
                    txtLabel2.Visible = true;
                    label29.Visible = true;
                    txtLabel3.Visible = true;
                    label30.Visible = true;
                    txtLabel4.Visible = true;


                    break;

            }
        }
        private void txtLabel1_TextChanged(object sender, EventArgs e)
        {
            data_label_1 = txtLabel1.Text;
        }

        private void txtLabel2_TextChanged(object sender, EventArgs e)
        {
            data_label_2 = txtLabel2.Text;
        }

        private void txtLabel3_TextChanged(object sender, EventArgs e)
        {
            data_label_3 = txtLabel3.Text;
        }

        private void txtLabel4_TextChanged(object sender, EventArgs e)
        {
            data_label_4 = txtLabel4.Text;
        }

        private void cmbMotion_SelectedIndexChanged(object sender, EventArgs e)
        {
            Motion = Convert.ToSingle(cmbMotion.Text);
        }

        private void txtReadingRate_TextChanged(object sender, EventArgs e)
        {
            Ex_Reading_Rate = txtReadingRate.Text.Trim();
        }

        

       
       
    }
}